package org.db2.project.airline.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import java.io.Serializable;


/**
 * The persistent class for the FLIGHTCLASS database table.
 */
@Entity
public class FlightClass implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @SequenceGenerator(name = "FLIGHTCLASS_ID_GENERATOR", sequenceName = "FLIGHTCLASS_SEQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "FLIGHTCLASS_ID_GENERATOR")
    private long id;

    private long startingSeatRow;

    private long endingSeatRow;

    //bi-directional many-to-one association to Airplane
    @ManyToOne
    @JoinColumn(name = "AIRPLANEID")
    private Airplane airplane;

    //bi-directional many-to-one association to FlightClassType
    @ManyToOne
    @JoinColumn(name = "CLASSTYPEID")
    private FlightClassType flightClassType;

    public FlightClass() {
    }

    public long getId() {
        return this.id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getEndingSeatRow() {
        return this.endingSeatRow;
    }

    public void setEndingSeatRow(long endingSeatRow) {
        this.endingSeatRow = endingSeatRow;
    }

    public long getStartingSeatRow() {
        return this.startingSeatRow;
    }

    public void setStartingSeatRow(long startingSeatRow) {
        this.startingSeatRow = startingSeatRow;
    }

    public Airplane getAirplane() {
        return this.airplane;
    }

    public void setAirplane(Airplane airplane) {
        this.airplane = airplane;
    }

    public FlightClassType getFlightClassType() {
        return this.flightClassType;
    }

    public void setFlightClassType(FlightClassType flightClassType) {
        this.flightClassType = flightClassType;
    }

}